package com.fh.alipay.model.convert;


import lombok.experimental.UtilityClass;
import com.fh.alipay.po.LqiMerchant;
import com.fh.alipay.model.dto.LqiMerchantDTO;
import com.fh.alipay.model.vo.LqiMerchantVO;
import java.util.ArrayList;
import java.util.List;

/**
 * @author fh
 * @date 2022-05-03
 * @description 猎奇商户转换类
 */

@UtilityClass
public class LqiMerchantConvert {


    public static LqiMerchant toPO(LqiMerchantDTO dto){
        LqiMerchant result = new LqiMerchant();
            result.setId(dto.getId());
            result.setCreateTime(dto.getCreateTime());
            result.setUpdateTime(dto.getUpdateTime());
            result.setAppKey(dto.getAppKey());
        return result;
    }

    public static LqiMerchantVO toVO(LqiMerchant po){
        LqiMerchantVO result = new LqiMerchantVO();
                result.setId(po.getId());
                result.setCreateTime(po.getCreateTime());
                result.setUpdateTime(po.getUpdateTime());
                result.setAppKey(po.getAppKey());
            return result;
    }
    public static List<LqiMerchantVO> toVO(List<LqiMerchant> pos){
        if(pos == null){
            return null;
        }
        List<LqiMerchantVO> list = new ArrayList<>();
        for(LqiMerchant po:pos){
            list.add(toVO(po));
        }
        return list;
    }

    public static List<LqiMerchant> toPO(List<LqiMerchantDTO> dtos){
        if(dtos == null) {
            return null;
        }
        List<LqiMerchant> list = new ArrayList<>();
        for(LqiMerchantDTO dto:dtos) {
            list.add(toPO(dto));
        }
        return list;
    }


}
